Conversation
Greptile SummaryThis PR migrates all webhook event type names from coarse single-word identifiers (e.g., Key changes:
Confidence Score: 3/5
|
| Filename | Overview |
|---|---|
| openapi/components/schemas/webhooks/WebhookType.yaml | Enum values updated from coarse single-word identifiers to dot-notation OBJECT.EVENT format; new statuses added (PENDING, PROCESSING, SENT, REFUNDED, EXPIRED, SUBMITTED, etc.) |
| openapi/components/schemas/webhooks/BaseWebhook.yaml | Added data as a required property; moved timestamp after type; removed discriminator mapping; description of data is slightly inaccurate for IncomingPaymentWebhook which adds extra fields beyond GET response |
| openapi/components/schemas/webhooks/CustomerKycWebhook.yaml | New schema replacing KycStatusWebhook; data field references only IndividualCustomer which may miss business/entity KYC events |
| openapi/components/schemas/webhooks/IncomingPaymentWebhook.yaml | Restructured to move transaction data + requestedReceiverCustomerInfoFields into unified data allOf; type narrowed to INCOMING_PAYMENT.* values |
| openapi/components/schemas/webhooks/OutgoingPaymentWebhook.yaml | Restructured with data referencing OutgoingTransaction; type narrowed to 7 new OUTGOING_PAYMENT.* variants |
| openapi/webhooks/outgoing-payment.yaml | Examples updated but completed payment example uses empty placeholder values (paymentInstructions: [], rateDetails: {}) and is missing examples for many of the 7 new event types |
| openapi/webhooks/incoming-payment.yaml | Examples updated for PENDING and COMPLETED; no example added for the new INCOMING_PAYMENT.FAILED type |
| mintlify/snippets/kyc/kyc-webhooks.mdx | Documentation updated to new CUSTOMER.* event types with expanded examples and updated code samples |
| mintlify/snippets/webhooks.mdx | Updated webhook type references in code examples and retry policy table to use new dot-notation pattern; test webhook example updated with new structure |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Grid API Event] -->|Sends| B[BaseWebhook\nid, type, timestamp, data]
B --> C{type prefix}
C -->|INCOMING_PAYMENT.*| D[IncomingPaymentWebhook\ndata: IncomingTransaction\n+ requestedReceiverCustomerInfoFields]
C -->|OUTGOING_PAYMENT.*| E[OutgoingPaymentWebhook\ndata: OutgoingTransaction]
C -->|CUSTOMER.*| F[CustomerKycWebhook\ndata: IndividualCustomer]
C -->|ACCOUNT.*| G[AccountStatusWebhook\ndata: InternalAccount + oldBalance]
C -->|INVITATION.*| H[InvitationClaimedWebhook\ndata: UmaInvitation]
C -->|BULK_UPLOAD.*| I[BulkUploadWebhook\ndata: BulkCustomerImportJob]
C -->|TEST| J[TestWebhookRequest\ndata: empty object]
D --> D1[PENDING\nCOMPLETED\nFAILED]
E --> E1[PENDING · PROCESSING\nSENT · COMPLETED\nFAILED · REFUNDED\nEXPIRED]
F --> F1[KYC_APPROVED · KYC_REJECTED\nKYC_SUBMITTED\nKYC_MANUALLY_APPROVED\nKYC_MANUALLY_REJECTED]
G --> G1[BALANCE_UPDATED]
H --> H1[CLAIMED]
I --> I1[COMPLETED · FAILED]
Last reviewed commit: d2d670f
ac110b3 to
3a66bc6
Compare
✱ Stainless preview buildsThis PR will update the kotlin openapi python typescript Edit this comment to update them. They will appear in their respective SDK's changelogs. ✅ grid-openapi studio · code · diff
✅ grid-python studio · code · diff
✅ grid-kotlin studio · code · diff
✅ grid-typescript studio · code · diff
This comment is auto-generated by GitHub Actions and is automatically kept up to date as you push. |
3a66bc6 to
3909f05
Compare
Additional Comments (3)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
12a7548 to
8c37e14
Compare
Additional Comments (5)
Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
|
8c37e14 to
0845a00
Compare
Additional Comments (5)
Affects lines 17, 41, 50, 66, 75, 81, 178, 214, 248 with tab titles, JSON examples, and code comparisons.
|
| - OUTGOING_PAYMENT.PENDING | ||
| - OUTGOING_PAYMENT.COMPLETED | ||
| - OUTGOING_PAYMENT.FAILED | ||
| - OUTGOING_PAYMENT.REFUNDED | ||
| - INCOMING_PAYMENT.PENDING | ||
| - INCOMING_PAYMENT.COMPLETED | ||
| - INCOMING_PAYMENT.FAILED |
There was a problem hiding this comment.
i thought there'd also be one for PROCESSING? cc @shreyav
There was a problem hiding this comment.
yep, and EXPIRED too please
There was a problem hiding this comment.
i investigated this with claude while making the change and:
┌────────────┬───────────┬────────────────────────────┐
│ Enum │ Resolved? │ Outgoing webhook mapping │
├────────────┼───────────┼────────────────────────────┤
│ CREATED │ No │ (no webhook fired) │
├────────────┼───────────┼────────────────────────────┤
│ PENDING │ No │ (no webhook fired) │
├────────────┼───────────┼────────────────────────────┤
│ PROCESSING │ No │ (no webhook fired) │
├────────────┼───────────┼────────────────────────────┤
│ SENT │ No │ (no webhook fired) │
├────────────┼───────────┼────────────────────────────┤
│ COMPLETED │ Yes │ OUTGOING_PAYMENT.COMPLETED │
├────────────┼───────────┼────────────────────────────┤
│ FAILED │ Yes │ OUTGOING_PAYMENT.FAILED │
├────────────┼───────────┼────────────────────────────┤
│ REJECTED │ Yes │ OUTGOING_PAYMENT.FAILED │
├────────────┼───────────┼────────────────────────────┤
│ REFUNDED │ Yes │ OUTGOING_PAYMENT.REFUNDED │
├────────────┼───────────┼────────────────────────────┤
│ EXPIRED │ Yes │ OUTGOING_PAYMENT.FAILED │
└────────────┴───────────┴────────────────────────────┘
There was a problem hiding this comment.
what does this output mean? don't we want to send webhooks for processing and expired?
There was a problem hiding this comment.
we don't currently sending webhooks for pending processing sent
There was a problem hiding this comment.
we don't for pending, but we should for the rest
6c8bf4c to
f585358
Compare
Additional Comments (3)
The old With the new dot-notation types, multiple enum values map to the same schema — e.g., Consider adding a discriminator:
propertyName: type
mapping:
OUTGOING_PAYMENT.PENDING: ./OutgoingPaymentWebhook.yaml
OUTGOING_PAYMENT.COMPLETED: ./OutgoingPaymentWebhook.yaml
OUTGOING_PAYMENT.FAILED: ./OutgoingPaymentWebhook.yaml
OUTGOING_PAYMENT.REFUNDED: ./OutgoingPaymentWebhook.yaml
INCOMING_PAYMENT.PENDING: ./IncomingPaymentWebhook.yaml
INCOMING_PAYMENT.COMPLETED: ./IncomingPaymentWebhook.yaml
INCOMING_PAYMENT.FAILED: ./IncomingPaymentWebhook.yaml
CUSTOMER.KYC_APPROVED: ./CustomerKycWebhook.yaml
CUSTOMER.KYC_REJECTED: ./CustomerKycWebhook.yaml
CUSTOMER.KYC_SUBMITTED: ./CustomerKycWebhook.yaml
CUSTOMER.KYC_MANUALLY_APPROVED: ./CustomerKycWebhook.yaml
CUSTOMER.KYC_MANUALLY_REJECTED: ./CustomerKycWebhook.yaml
ACCOUNT.BALANCE_UPDATED: ./AccountStatusWebhook.yaml
INVITATION.CLAIMED: ./InvitationClaimedWebhook.yaml
BULK_UPLOAD.COMPLETED: ./BulkUploadWebhook.yaml
BULK_UPLOAD.FAILED: ./BulkUploadWebhook.yaml
TEST: ./TestWebhookRequest.yaml
The If only individual customers trigger KYC webhooks this is intentional — but it is worth adding a comment to make that explicit. If business customers can also receive KYC webhooks, consider making data:
oneOf:
- $ref: ../customers/IndividualCustomer.yaml
- $ref: ../customers/BusinessCustomer.yaml
The |
…ation types - Adopt OBJECT.EVENT dot-notation for all webhook types (e.g., OUTGOING_PAYMENT.COMPLETED) - Wrap all webhook data under a unified `data` key (Stripe-style full resource embed) - Rename webhook files to match resource-event pattern - Move test webhook endpoint to /sandbox/webhooks/test - Update documentation and examples to match new schema
f585358 to
d2d670f
Compare
Additional Comments (3)
If business customers are never subject to these webhooks, a comment clarifying this constraint would prevent confusion. If they are, consider a oneOf/anyOf union: data:
oneOf:
- $ref: ../customers/IndividualCustomer.yaml
- $ref: ../customers/BusinessCustomer.yaml
The Consider adjusting the description to acknowledge that the data:
type: object
description: >-
The primary resource object associated with this event. For most event types,
this mirrors the corresponding GET endpoint response, but may include
additional webhook-specific fields (e.g., requestedReceiverCustomerInfoFields
on INCOMING_PAYMENT.PENDING).
The completed outgoing payment example now contains Additionally, the 7 new |

TL;DR
Updated webhook event type names to be more descriptive and consistent.
Changes defined in https://docs.google.com/document/d/1YdRboRlrwm0HKmRdyp-lbHZcfYUtJMF5NWk35vd_dZI/edit?tab=t.0